#pragma once

#include <QtCore/QString>
#include <QtCore/QByteArray>

#include "exports.hpp"




class ENGINE_CORE_API File
{
public:

	/**
	 * Opens a file through the give file object.
	 */
	static void open(QFile& file, const QString& fname);

	/**
	 * Reads the entire file into memory and throws an exception in case the file
	 * does not exist/could be opened or when it could not be read.
	 */
	static QByteArray readAll(const QString& fname);

	/**
	 * Returns a readable string for the given error code.
	 */
	static const char* errorString(QFile::FileError error);
};
///////////////////////////////////////////////////////////////////////////////////////////////////
